export default {
	showInfo(content, fnOk) {
		uni.showModal({
			title: '信息',
			content,
			showCancel: false,
			cancelText: '取消',
			confirmText: '确定',
			success(res) {
				console.log(res)
				if (res.confirm && fnOk) {
					fnOk()
				}
			}
		})
	},
	showSuccess(content, fnOk) {
		uni.showModal({
			title: '提示',
			content,
			showCancel: false,
			cancelText: '取消',
			confirmText: '确定',
			success(res) {
				if (res.confirm && fnOk) {
					fnOk()
				}
			}
		})
	},
	showWarn(content, fnOk) {
		uni.showModal({
			title: '警告',
			content,
			showCancel: false,
			cancelText: '取消',
			confirmText: '确定',
			success(res) {
				if (res.confirm && fnOk) {
					fnOk()
				}
			}
		})
	},
	showError(content, fnOk) {
		uni.showModal({
			title: '错误',
			content,
			showCancel: false,
			cancelText: '取消',
			confirmText: '确定',
			success(res) {
				if (res.confirm && fnOk) {
					fnOk()
				}
			}
		})
	},
	showConfirm(content, fnOk, fnCancel) {
		uni.showModal({
			title: '请确认',
			content,
			cancelText: '取消',
			confirmText: '确定',
			success(res) {
				if (res.confirm) {
					fnOk && fnOk();
				} else if (res.cancel) {
					fnCancel && fnCancel();
				}
			}
		})
	},
	showLoading(title) {
		uni.showToast({
			title,
			mask: true,
		})
	},
	showToast(title) {
		uni.showToast({
			title,
			mask: true,
		})
	},
	showErrorToast(title) {
		uni.showToast({
			icon: 'error',
			title,
			mask: true,
		})
	}
}